home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-12 | 1.2 KB | 52 lines | [TEXT/MMCC] |
- /*
- File: PreferencesDialogWindow.cp
-
- Contains: A simple dialog window recipe
-
- Written by: Dave Falkenburg
-
- Copyright: © 1993-94 by Dave Falkenburg, all rights reserved.
-
- Change History (most recent first):
-
- <3> 11/12/94 DRF Set default & cancel items as well as cursor tracking.
- <2> 9/9/94 DRF Removed redundant #include.
- */
-
- #include "PreferencesDialogWindow.h"
-
- TPreferencesDialogWindow::TPreferencesDialogWindow() : TDialogWindow(kPreferencesDialogTemplateID)
- {
- // Because TDialogWindow::TDialogWindow has already created the dialog,
- // this is a great place to grab settings & setup the contents of the
- // dialog.
- //
- // Of course, if you do this you probably want to mark the DLOG
- // as not initially visible, then call ShowWindow just before returning.
- //
- // You should also setup UPPs for any user items in here, too.
-
- // Set up the default buttons
- // Isn’t it neat that these also work for modeless dialogs?
-
- SetDialogDefaultItem(fWindow,ok);
- SetDialogCancelItem(fWindow,cancel);
- SetDialogTracksCursor(fWindow,true);
- }
-
- void
- TPreferencesDialogWindow::ItemHit(short theItem)
- {
- switch (theItem)
- {
- case ok:
- case cancel:
- this->Close();
- delete this;
- break;
-
- default:
- break;
- }
- }
-